home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / usr / gcc-1.37.1r14 / object oriented files / CPathTable.cp < prev    next >
Encoding:
Text File  |  1994-12-05  |  1.9 KB  |  70 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CPathTable.c
  3.  
  4.         
  5.     SUPERCLASS = CArrayPane
  6.     
  7.     Copyright © 1991 Symantec Corporation. All rights reserved.
  8.     
  9.  
  10.  ******************************************************************************/
  11.  
  12. #include "CPathTable.h"
  13. #include "CPathArray.h"
  14.  
  15. /******************************************************************************
  16.  IPathTable
  17. ******************************************************************************/
  18.  
  19. void CPathTable::IPathTable( CView *anEnclosure, CBureaucrat *aSupervisor,
  20.                         short aWidth, short aHeight,
  21.                         short aHEncl, short aVEncl,
  22.                         SizingOption aHSizing, SizingOption aVSizing)
  23. {
  24.     CArrayPane::IArrayPane( anEnclosure, aSupervisor, aWidth, aHeight,
  25.                     aHEncl, aVEncl, aHSizing, aVSizing);
  26.  
  27. }    /* CPathTable::IPathTable */
  28.  
  29. /******************************************************************************
  30.  GetCellText
  31. ******************************************************************************/
  32.  
  33. void CPathTable::GetCellText( Cell aCell, short availableWidth, StringPtr itsText)
  34. {
  35.   FSSpec    thespec;
  36.   ASSERT( member( itsArray, CPathArray));
  37.     
  38.   if (itsArray)
  39.     {
  40.     Str255 defpath;
  41.     OSErr err;
  42.     CInfoPBRec  cPB;
  43.     itsArray->GetItem( &thespec, aCell.v+1);
  44.     cPB.dirInfo.ioDrParID = thespec.parID;
  45.     defpath[0] = 0;
  46.     do
  47.         {
  48.         Str255 tmp;
  49.         BlockMove(defpath,tmp,1+*defpath);
  50.         /* get information about dir */
  51.         cPB.hFileInfo.ioCompletion = (ProcPtr)0L;
  52.         cPB.hFileInfo.ioNamePtr = (StringPtr)defpath;
  53.         cPB.hFileInfo.ioVRefNum = thespec.vRefNum;
  54.         cPB.hFileInfo.ioFDirIndex = -1;
  55.         cPB.hFileInfo.ioDirID = cPB.dirInfo.ioDrParID;
  56.  
  57.         err = PBGetCatInfoSync(&cPB); 
  58.         if (!err)
  59.             {
  60.             BlockMove(tmp, &defpath[1+*defpath], 1+*tmp);
  61.             defpath[1+*defpath] = ':';
  62.             defpath[0] += 1+*tmp;
  63.             }
  64.         }
  65.     while (!err);
  66.     BlockMove(defpath, itsText, 1+*defpath);
  67.     }
  68.  
  69. }    /* CPathTable::GetCellText */
  70.